package com.kayt.cyberBar.cuser.business.entity.vo;

import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.Date;

public class LoginCacheVO implements Comparable<LoginCacheVO> {
	private String userAccount;
	private String iemi;
	private String sign;
	private Date createTime;

	public String getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}

	public String getIemi() {
		return iemi;
	}

	public void setIemi(String iemi) {
		this.iemi = iemi;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Override
	public String toString() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return userAccount+"--"+sdf.format(createTime);
	}

	@Override
	public int compareTo(LoginCacheVO arg0) {
		Long time0 = arg0.getCreateTime().getTime();
		Long time1 = this.getCreateTime().getTime();
		if (time0 > time1) {
			return -1;
		} else if (time0 == time1) {
			return 0;
		} else {
			return 1;
		}
	}
}
